package com.drojian.demo1.root_fragment;

import android.content.Intent;
import android.os.Bundle;

import androidx.fragment.app.Fragment;

import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;

import com.drojian.demo.R;
import com.drojian.demo1.test1.ButtonActivity;
import com.drojian.demo1.test1.CheckBoxActivity;
import com.drojian.demo1.test1.EditTextActivity;
import com.drojian.demo1.test1.ImageViewActivity;
import com.drojian.demo1.test1.RadioButtonActivity;
import com.drojian.demo1.test1.RadioGroupActivity;
import com.drojian.demo1.test1.SwitchActivity;
import com.drojian.demo1.test1.TextViewActivity;
import com.drojian.demo1.test1.ToolButtonActivity;
import com.drojian.screenAdaptation.ScreenTestActivity;
import com.drojian.screenAdaptation2.ScreenTest2Activity;


public class RootFragment1 extends Fragment {




    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.ui1_fragment_root1, container, false);

        Button textView = view.findViewById(R.id.textView);
        Button button = view.findViewById(R.id.button);
        Button editText = view.findViewById(R.id.editText);
        Button imageView = view.findViewById(R.id.imageView);
        Button radioGroup = view.findViewById(R.id.radioGroup);
        Button radioButton = view.findViewById(R.id.radioButton);
        Button checkBox = view.findViewById(R.id.checkBox);
        Button toolButton = view.findViewById(R.id.toolButton);
        Button switch1 = view.findViewById(R.id.switch1);
        Button screen = view.findViewById(R.id.screen);
        Button screen1 = view.findViewById(R.id.screen1);
        textView.setOnClickListener(v -> startActivity(new Intent(getContext(), TextViewActivity.class)));

        button.setOnClickListener(v -> {
            Intent intent = new Intent(getContext(), ButtonActivity.class);
            startActivity(intent);
        });
        editText.setOnClickListener(v -> {
            Intent intent = new Intent(getContext(), EditTextActivity.class);
            startActivity(intent);
        });
        imageView.setOnClickListener(v -> {
            Intent intent = new Intent(getContext(), ImageViewActivity.class);
            startActivity(intent);
        });
        radioGroup.setOnClickListener(v -> startActivity(new Intent(getContext(), RadioGroupActivity.class)));
        radioButton.setOnClickListener(v -> startActivity(new Intent(getContext(), RadioButtonActivity.class)));
        checkBox.setOnClickListener(v -> startActivity(new Intent(getContext(), CheckBoxActivity.class)));
        toolButton.setOnClickListener(v -> startActivity(new Intent(getContext(), ToolButtonActivity.class)));
        switch1.setOnClickListener(v -> startActivity(new Intent(getContext(), SwitchActivity.class)));
        screen.setOnClickListener(v -> startActivity(new Intent(getContext(), ScreenTestActivity.class)));
        screen1.setOnClickListener(v -> startActivity(new Intent(getContext(), ScreenTest2Activity.class)));

        return view ;
    }
    public static RootFragment1 newInstance() {
        return new RootFragment1();
    }
}